class Solution
{
public:
    vector<vector<int>> fileCombination(int target)
    {
        int i = 1;
        int j = 1;
        int sum = 0;
        vector<vector<int>> ans;

        while (i <= target / 2)
        {
            if (sum < target)
            {
                sum += j;
                j++;
            }
            else if (sum > target)
            {
                sum -= i;
                i++;
            }
            else
            {
                vector<int> arr;
                for (int k = i; k < j; k++)
                    arr.push_back(k);

                ans.push_back(arr);
                sum -= i;
                i++;
            }
        }

        return ans;
    }
};